import tushare as ts

def save2file(stock_code=None):
    df=ts.get_hist_data(stock_code)
    szFile=stock_code+'.csv'
    df.to_csv(szFile)
    #df.to_csv('c:/day/600848.csv',columns=['open','high','low','close'])

    #hs300=ts.get_hs300s()
    #sh=ts.get_hist_data('sh')
    #sh.to_csv('./sh.csv')
    return stock_code+'.csv'

if __name__ == '__main__':
    save2file("002846")

